#include "main/utils.h"
using namespace std;

int permuteNum(const vector<int>& arr, const int& target) {
  int len = arr.size();
  vector<int> dp(target + 1, 0);
  dp[0] = 1;
  for (int i = 1; i <= target; ++i) {
    for (int j = 0; j < len; ++j) {
      if (i >= arr[j])
        dp[i] = dp[i] + dp[i - arr[j]];
    }
  }
  return dp[target];
}

int main() {
  vector<int> arr = {1, 2, 3};
  cout << permuteNum(arr, 3) << endl;

  return 0;
}
